package com.dcits.dubbo.Controller;

import com.alibaba.dubbo.config.annotation.Reference;

import com.dcits.api.ApiService;
import com.dcits.api.entity.ApiInfo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/Api")
public class ApiInfoController {

    private static Logger log = LoggerFactory.getLogger(ApiInfoController.class);

    @Reference(version = "1.0.0",timeout = 3000)
    private ApiService apiservice;

    @RequestMapping("/getInfos")
    public ApiInfo getInfos(@RequestBody String ApiId){
        ApiInfo info = new ApiInfo();

        if(log.isInfoEnabled()){
            log.info("获取到的API_ID是" +ApiId);
        }

        info.setApiId(ApiId);

        return apiservice.GetApiInfo(info);
    }

}
